function Y=par_solver_policy(vec,g_target,rd_sales_h,rd_sales_l,range_h,range_l,trans_target)

global eta lambda zeta
global chi nu
global epsilon beta delta delta_p
global Q alphah alphal mh ml zbar
global tau ss

options=optimoptions('fsolve','Display','off');

iota=vec(1);
mu=vec(2);
gamma=vec(3);
rho=vec(4);
phi=vec(5);
theta=vec(6);

guess=[0.9,0.1,11,2,1,6,1,2];
geq_vec=@(input)geq_solver_policy(input,iota,mu,gamma,rho,phi,theta);
[answer,~,exitflag] = fsolve(geq_vec, guess, options);

ih=answer(1);
il=answer(2);
omegah=answer(3);
omegal=answer(4);
a=answer(5);
ns=answer(8);

nbh=alphah*(1-ih*X(omegah));
nbl=alphal*(1-il*X(omegal));
nb=nbh+nbl;
mb=phi*(ns/nb)^nu;
ms=phi*(nb/ns)^(1-nu);

eh=(alphah*mh*a+alphal*ml)*(alphah*Q(1,1)+alphal*Q(2,1))/((alphah*mh+alphal*ml)*(alphah*Q(1,1)*a+alphal*Q(2,1)));
el=(alphah*mh*a+alphal*ml)*(alphal*Q(2,2)+alphah*Q(1,2))/((alphah*mh+alphal*ml)*(alphal*Q(2,2)+alphah*Q(1,2)*a));
gh=1+gamma*eh*(ih*X(omegah)+(1-ih*X(omegah))*mb);
gl=1+gamma*el*(il*X(omegal)+(1-il*X(omegal))*mb);

g_avg=gh*(alphah*Q(1,1)+alphal*Q(2,1)/a)/(alphah*Q(1,1)+alphal*Q(2,1));
rm=beta/(g_avg^(epsilon*zeta/(lambda+zeta)));
rt=1/rm-1+delta;
w=lambda*((eta/rt)^(eta/(zeta+lambda)))*((alphah*mh+alphal*ml)*g_avg*zbar)^(zeta/(lambda+zeta));

zlbar=(alphah*mh+alphal*ml)*zbar/(alphah*mh*a+alphal*ml);
zhbar=a*zlbar;    

rd_exp_h=(1-ss)*chi*(zbar^(zeta/(zeta+lambda)))*(ih^(1+rho))/(1+rho);
rd_exp_l=(1-ss)*chi*(zbar^(zeta/(zeta+lambda)))*(il^(1+rho))/(1+rho);

zhr=(alphah*Q(1,1)*zhbar+alphal*Q(2,1)*zlbar)/(alphah*Q(1,1)+alphal*Q(2,1));
zlr=(alphah*Q(1,2)*zhbar+alphal*Q(2,2)*zlbar)/(alphah*Q(1,2)+alphal*Q(2,2));

Yh=mh*gh*zhr*((eta/rt)^(eta/zeta))*((lambda/w)^(lambda/zeta));
Yl=ml*gl*zlr*((eta/rt)^(eta/zeta))*((lambda/w)^(lambda/zeta));

rd_Y_h=rd_exp_h/Yh;
rd_Y_l=rd_exp_l/Yl;

patent_count=alphah*ih+alphal*il;
trans_share=(alphah*ih*(1-X(omegah))+alphal*il*(1-X(omegal)))*(ms*(1-((1-ms)*delta_p)^10))/((1-(1-ms)*delta_p)*patent_count);

zeroes(1)=(g_target-g_avg)/g_target;                  
zeroes(2)=(rd_sales_h-rd_Y_h)/rd_sales_h;
zeroes(3)=(rd_sales_l-rd_Y_l)/rd_sales_l;                   
zeroes(4)=(range_h-omegah)/range_h;
zeroes(5)=(range_l-omegal)/range_l;                   
zeroes(6)=(trans_target-trans_share)/trans_target;
Y=zeroes*zeroes';

